<?php declare(strict_types=1);


namespace App\Model\Entity;

use Swoft\Db\Annotation\Mapping\Column;
use Swoft\Db\Annotation\Mapping\Entity;
use Swoft\Db\Annotation\Mapping\Id;
use Swoft\Db\Eloquent\Model;


/**
 * 第三方登陆授权记录表
 * Class OauthAccount
 *
 * @since 2.0
 *
 * @Entity(table="oauth_account")
 */
class OauthAccount extends Model
{
    /**
     * 
     * @Id()
     * @Column()
     *
     * @var int
     */
    private $id;

    /**
     * 
     *
     * @Column(name="member_id", prop="memberId")
     *
     * @var int
     */
    private $memberId;

    /**
     * 
     *
     * @Column()
     *
     * @var string|null
     */
    private $userinfo;

    /**
     * 第三方标识，1:facebook 2:twitter 3:vk
     *
     * @Column(name="oauth_type", prop="oauthType")
     *
     * @var int
     */
    private $oauthType;

    /**
     * 第三方userid，组合主键
     *
     * @Column(name="open_id", prop="openId")
     *
     * @var string
     */
    private $openId;

    /**
     * 第三方认证token
     *
     * @Column(name="access_token", prop="accessToken")
     *
     * @var string
     */
    private $accessToken;

    /**
     * 
     *
     * @Column(name="access_token_secret", prop="accessTokenSecret")
     *
     * @var string|null
     */
    private $accessTokenSecret;

    /**
     * 第三方认证，防止token过期
     *
     * @Column(name="refresh_token", prop="refreshToken")
     *
     * @var string|null
     */
    private $refreshToken;

    /**
     * 有效期
     *
     * @Column(name="expires_in", prop="expiresIn")
     *
     * @var int|null
     */
    private $expiresIn;

    /**
     * 
     *
     * @Column(name="updated_at", prop="updatedAt")
     *
     * @var int|null
     */
    private $updatedAt;

    /**
     * 
     *
     * @Column(name="created_at", prop="createdAt")
     *
     * @var int
     */
    private $createdAt;

    /**
     * 是否填写密码，0：未填写 1：已填写
     *
     * @Column(name="is_password", prop="isPassword")
     *
     * @var int
     */
    private $isPassword;


    /**
     * @param int $id
     *
     * @return void
     */
    public function setId(int $id): void
    {
        $this->id = $id;
    }

    /**
     * @param int $memberId
     *
     * @return void
     */
    public function setMemberId(int $memberId): void
    {
        $this->memberId = $memberId;
    }

    /**
     * @param string|null $userinfo
     *
     * @return void
     */
    public function setUserinfo(?string $userinfo): void
    {
        $this->userinfo = $userinfo;
    }

    /**
     * @param int $oauthType
     *
     * @return void
     */
    public function setOauthType(int $oauthType): void
    {
        $this->oauthType = $oauthType;
    }

    /**
     * @param string $openId
     *
     * @return void
     */
    public function setOpenId(string $openId): void
    {
        $this->openId = $openId;
    }

    /**
     * @param string $accessToken
     *
     * @return void
     */
    public function setAccessToken(string $accessToken): void
    {
        $this->accessToken = $accessToken;
    }

    /**
     * @param string|null $accessTokenSecret
     *
     * @return void
     */
    public function setAccessTokenSecret(?string $accessTokenSecret): void
    {
        $this->accessTokenSecret = $accessTokenSecret;
    }

    /**
     * @param string|null $refreshToken
     *
     * @return void
     */
    public function setRefreshToken(?string $refreshToken): void
    {
        $this->refreshToken = $refreshToken;
    }

    /**
     * @param int|null $expiresIn
     *
     * @return void
     */
    public function setExpiresIn(?int $expiresIn): void
    {
        $this->expiresIn = $expiresIn;
    }

    /**
     * @param int|null $updatedAt
     *
     * @return void
     */
    public function setUpdatedAt(?int $updatedAt): void
    {
        $this->updatedAt = $updatedAt;
    }

    /**
     * @param int $createdAt
     *
     * @return void
     */
    public function setCreatedAt(int $createdAt): void
    {
        $this->createdAt = $createdAt;
    }

    /**
     * @param int $isPassword
     *
     * @return void
     */
    public function setIsPassword(int $isPassword): void
    {
        $this->isPassword = $isPassword;
    }

    /**
     * @return int
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return int
     */
    public function getMemberId(): ?int
    {
        return $this->memberId;
    }

    /**
     * @return string|null
     */
    public function getUserinfo(): ?string
    {
        return $this->userinfo;
    }

    /**
     * @return int
     */
    public function getOauthType(): ?int
    {
        return $this->oauthType;
    }

    /**
     * @return string
     */
    public function getOpenId(): ?string
    {
        return $this->openId;
    }

    /**
     * @return string
     */
    public function getAccessToken(): ?string
    {
        return $this->accessToken;
    }

    /**
     * @return string|null
     */
    public function getAccessTokenSecret(): ?string
    {
        return $this->accessTokenSecret;
    }

    /**
     * @return string|null
     */
    public function getRefreshToken(): ?string
    {
        return $this->refreshToken;
    }

    /**
     * @return int|null
     */
    public function getExpiresIn(): ?int
    {
        return $this->expiresIn;
    }

    /**
     * @return int|null
     */
    public function getUpdatedAt(): ?int
    {
        return $this->updatedAt;
    }

    /**
     * @return int
     */
    public function getCreatedAt(): ?int
    {
        return $this->createdAt;
    }

    /**
     * @return int
     */
    public function getIsPassword(): ?int
    {
        return $this->isPassword;
    }

}
